@extends('layouts.app')

@section('content')
    <section class="content-header">
        <h1 class="pull-left">商品批量修改(有属性的商品数量不支持修改)</h1>
        <h1 class="pull-right">
        </h1>

        <div class="" style="clear: both">
        </div>
    </section>
    <div class="content">
        <div class="clearfix"></div>

        @include('flash::message')

        {!! Form::open(['route' => 'goods.batch_operation_post','method'=>'POST']) !!}
        <div class="clearfix"></div>
        <div class="box box-primary">
            <div class="box-body">
                    <table class="table table-responsive" id="goods-table">
                        <thead>
                        <th>ID</th>
                        {{--<th>分类</th>--}}
                        <th>编号</th>
                        <th>名称</th>
                        <th>补充名称</th>
                        <th>点击量</th>
                        <th>销售量</th>
                        <th>数量</th>
                        <th>市场价</th>
                        <th>优惠价</th>
                        <th>单位</th>
                        <th>销售开始时间</th>
                        <th>销售结束时间</th>
                        <th>排序值(越小越靠前)</th>
                        </thead>
                        <tbody>
                        @foreach($goods as $v)
                            <tr>
                                <td>{!! $v->id !!}
                                    <input type="hidden" name="ids[]" value="{{$v->id}}">
                                </td>
                                {{--<td>--}}
                                    {{--@foreach($v->categories as $cat)--}}
                                        {{--{{ $cat->name }}--}}
                                    {{--@endforeach--}}
                                {{--</td>--}}
                                <td><input type="text" size="5" name="{{$v->id}}_sn" value="{!! $v->sn !!}"></td>
                                <td><input type="text" size="5" name="{{$v->id}}_name" value="{!! $v->name !!}"></td>
                                <td><input type="text" size="5" name="{{$v->id}}_title" value="{!! $v->title !!}"></td>
                                <td><input type="text" size="5" name="{{$v->id}}_click_count" value="{!! $v->click_count !!}"></td>
                                <td><input type="text" size="5" name="{{$v->id}}_sales_count" value="{!! $v->sales_count !!}"></td>
                                <td>
                                    @if($v->attributesByStatus->count()==0)
                                        <input type="text" size="5" name="{{$v->id}}_number" value="{!! $v->number !!}">
                                    @else
                                        {!! $v->number !!}
                                    @endif
                                </td>
                                <td><input type="text" size="5" name="{{$v->id}}_market_price" value="{!! $v->market_price !!}"></td>
                                <td><input type="text" size="5" name="{{$v->id}}_sale_price" value="{!! $v->sale_price !!}"></td>
                                <td><input type="text" size="5" name="{{$v->id}}_unit" value="{!! $v->unit !!}"></td>
                                <td><input type="text" size="5" name="{{$v->id}}_sale_start_date" value="{!! $v->sale_start_date !!}"></td>
                                <td><input type="text" size="5" name="{{$v->id}}_sale_end_date" value="{!! $v->sale_end_date !!}"></td>
                                <td><input type="text" size="5" name="{{$v->id}}_sort" value="{!! $v->sort !!}"></td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
            </div>
        </div>
        {!! Form::submit('确认', ['class' => 'btn btn-primary']) !!}
        {!! Form::close() !!}
    </div>
@endsection

